#pragma once

#using <System.dll>
#include "hv/requests.h"
#include "HttpWebResponse.h"
#include "HttpWebRequest.h"

using namespace System;
using namespace System::Collections::Specialized;
using namespace System::IO;

namespace Ws2Com {
	namespace Http {
		public ref class ProxyClient {
		public:
			String^ Host;
			int Port;
		};

		public ref class WebProxy {
		public:
			ProxyClient^ HttpProxy;
			ProxyClient^ HttpsProxy;
		};
		public ref class HttpClient {
		private:
			http_client_t* client;
			WebProxy^ proxy;

		public:
			HttpClient();
			HttpClient(WebProxy^ proxy);

			~HttpClient();

			String^ Send(HttpWebRequest^ request);
			HttpWebResponse^ SendToStream(HttpWebRequest^ request);
			Stream^ SendToStream(HttpWebRequest^ request, [Runtime::InteropServices::Out]bool% compress);
		private:
			void SetProxy(HttpRequest req);
		};
	}
}